package com.menghao.sso.server.service;

import com.menghao.sso.server.exception.ValidateFailException;
import com.menghao.sso.server.model.Service;
import com.menghao.sso.server.model.credentials.Credentials;

/**
 * <p>认证服务.<br>
 *
 * @author menghao.
 * @version 2017/11/16.
 */
public interface AuthenticationService {

    /**
     * 验证凭证（用户名/服务）
     *
     * @param credentials 凭证
     * @throws ValidateFailException
     */
    void validateCredentials(Credentials credentials) throws ValidateFailException;

    /**
     * 验证ServiceTicket
     *
     * @param serviceTicketId ST.ID
     * @param service         对应服务
     * @throws ValidateFailException
     */
    void validateServiceTicket(String serviceTicketId, Service service) throws ValidateFailException;

    /**
     * 验证TicketGrantingTicket
     *
     * @param ticketGrantingTicketId TGT.ID
     * @throws ValidateFailException
     */
    void validateGrantingTicket(String ticketGrantingTicketId) throws ValidateFailException;

}
